package main

import (
	"net/http"

	"github.com/gin-gonic/gin"
)

var Router *gin.Engine

func SetupRouter() *gin.Engine {
	// gin.SetMode(gin.ReleaseMode)
	gin.SetMode(gin.DebugMode)
	Router = gin.Default()
	Router.GET("/check/:data", CtrlCheck)
	Router.GET("/insert/:data", CtrlInsert)
	Router.GET("/manage/init/:b/:e/:tb/:te/:td", CtrlManageInit)
	Router.GET("/manage/stat", CtrlManageStat)
	Router.GET("/manage/clear", CtrlManageClear)

	Router.NoRoute(func(ctx *gin.Context) {
		ctx.Status(http.StatusNotFound)
	})
	return Router
}
